package cn.wen.yinxiu.member.service;

import cn.wen.yinxiu.member.vo.TalkBoxInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.wen.yinxiu.common.toolkit.PageUtils;
import cn.wen.yinxiu.member.entity.TalkBoxEntity;

import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @ClassName: TalkBoxService
 * @Author 小飞
 * @Email coderwen22@163.com
 * @Date 2023-05-21 22:19:26
 * @Description:
 */
public interface TalkBoxService extends IService<TalkBoxEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 通过用户Id获取聊天窗口的列表
     * @param userId
     * @return
     */
    List<TalkBoxEntity> queryTalkBoxInfoListByUserId(Long userId);

    /**
     * 添加聊天窗口
     *
     * @param talkBox
     */
    boolean saveTalkBoxInfo(TalkBoxEntity talkBox);

    /**
     * 删除聊天窗口
     * @param talkBoxId
     *
     */
    void deleteUserTalk(Long talkBoxId);

    /**
     * 查询用户的群聊窗口
     * @param userId
     * @return
     */
    List<Long> queryTalkBoxGroupIdList(Long userId);

    /**
     * 校验是否存在窗口
     * @param userId
     * @param talkId
     * @param talkType
     * @return
     */
    TalkBoxEntity getUserTalkBox(Long userId, Long talkId, Integer talkType);

    /**
     * 分页获取聊天窗口和聊天记录
     *
     * @param userId
     * @param talkPage
     * @return
     */
    List<TalkBoxInfo> queryTalkBoxInfoList(Long userId, Integer talkPage);

    /**
     * 置顶聊天
     *
     * @param chatBoxId
     * @return
     */
    boolean topChatTalkBox(Long chatBoxId);

    /**
     * 删除聊天窗口
     *
     * @param chatBoxId
     * @return
     */
    boolean deleteChatTalkBox(Long chatBoxId);

    /**
     * 添加窗口
     * @param userId
     * @param talkId
     * @param talkType
     */
    boolean addTalkBoxInfo(Long userId, Long talkId, Integer talkType);

    /**
     * 通过聊天类型获取聊天窗口
     *
     * @param userId
     * @param talkType
     * @param talkPage
     * @return
     */
    List<TalkBoxInfo> queryTalkBoxInfoListByType(Long userId, Integer talkType, Integer talkPage);

}

